﻿using System.Web.Mvc;
using System.Web.Routing;
namespace WebSiteFool
{
    public class RestrictAuthorizeAttribute : AuthorizeAttribute
    {
        protected override void HandleUnauthorizedRequest(AuthorizationContext filterContext)
        {
            base.HandleUnauthorizedRequest(filterContext);
            filterContext.Result = new RedirectToRouteResult(new RouteValueDictionary { { "action", "Error" }, { "controller", "Home" } });
        }
    }
}